package com.yc.navy.goods.feign.controller;


import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import com.yc.navy.goods.dto.AddressInfoDTO;
import com.yc.navy.goods.dto.AddressInfoDTODTO;
import com.yc.navy.goods.service.IAddressInfoService;

@RestController
@RequestMapping("/addrs")
public class AddrFeignClientController {
	@Autowired
	private IAddressInfoService addressInfoService;
	
	@RequestMapping("/myaddr")
	AddressInfoDTODTO myaddr (@RequestParam Integer mid){
		System.out.println("mid*** = " + mid);
		AddressInfoDTO address = addressInfoService.myaddr(mid);
		AddressInfoDTODTO addressDTO = new AddressInfoDTODTO();
		System.out.println("address = " + address + "addressDTO = " + addressDTO);
		BeanUtils.copyProperties(address, addressDTO);
		return addressDTO;
	}
}
